//
//  XSJLiveNowTableCell.m
//  XSJ
//
//  Created by yuanyuan he on 2020/5/9.
//  Copyright © 2020 apple. All rights reserved.
//

#import "XSJLiveNowTableCell.h"

@interface XSJLiveNowTableCell()

@property (nonatomic, strong) UIButton *liveButton;

@end

@implementation XSJLiveNowTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self setup];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setup
{
    self.contentView.backgroundColor = ColorHex(0xffffff);
    [self.contentView addSubview:self.liveButton];
    
    [_liveButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.mas_equalTo(20);
    }];
}

- (void)liveButtonDidClick
{
    
}

- (UIButton *)liveButton {
    if (_liveButton == nil) {
        _liveButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _liveButton.backgroundColor = ColorHex(0xffffff);
        [_liveButton setTitle:@"立即直播" forState:UIControlStateNormal];
        [_liveButton setBackgroundImage:[UIImage imageNamed:@"Sign2"] forState:UIControlStateNormal];
        _liveButton.titleLabel.font = [UIFont systemFontOfSize:14];
        _liveButton.layer.cornerRadius = 7.0f;
        _liveButton.clipsToBounds = YES;
        [_liveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        //不接受点击事件
        _liveButton.userInteractionEnabled = NO;
        [_liveButton addTarget:self action:@selector(liveButtonDidClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _liveButton;
}


@end
